//package com.ruoyi.security.filter;
//
//import eu.bitwalker.useragentutils.DeviceType;
//import eu.bitwalker.useragentutils.OperatingSystem;
//import eu.bitwalker.useragentutils.UserAgent;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.stereotype.Component;
//import org.springframework.web.filter.OncePerRequestFilter;
//
//import javax.servlet.FilterChain;
//import javax.servlet.ServletException;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//
//@Component
//@Slf4j
//public class MiniprogramAuthenticationTokenFilter extends OncePerRequestFilter {
//
//    @Override
//    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
//        String agent = request.getHeader("User-Agent"); //示例："Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
//        //解析agent字符串
//        UserAgent userAgent = UserAgent.parseUserAgentString(agent);
//        //获取操作系统对象
//        OperatingSystem operatingSystem = userAgent.getOperatingSystem();
//        DeviceType deviceType = operatingSystem.getDeviceType(); // 可能取值：COMPUTER：电脑浏览器，MOBILE：手机端，如微信小程序等。
//        log.info("访问设备类型: {}", deviceType);
//
//        if (deviceType == DeviceType.MOBILE) {
//
//        }
//
//        filterChain.doFilter(request, response);
//    }
//}
